package com.backend.struts;

import com.backend.utils.CommonStringUtils;
import lombok.Data;

import java.io.Serializable;
import java.util.Map;

@Data
public class UserInfo implements Serializable {
    public Integer userId;
    public String username;
    public String imgPath;

    public UserInfo() {
    }

    public UserInfo(Map<String, String> map) {
        if (map == null) {
            return;
        }
        this.userId = CommonStringUtils.safeInteger(map.get("user_id"));
        this.username = CommonStringUtils.safeString(map.get("username"));
        this.imgPath = CommonStringUtils.safeString(map.get("img_path"));
    }
}
